package com.ahaoyou.listener;

/**
 * @author LH
 * @create 2022/9/1 15:28
 */
public class Event {
    protected transient Object source;

    public Event(Object source) {
        if (source == null)
            throw new IllegalArgumentException("null source");
        this.source = source;
    }

    public Object getSource() {
        return source;
    }

}

class DogEvent extends Event {

    public DogEvent(Object source) {
        super(source);
    }
}

class CatEvent extends Event {

    public CatEvent(Object source) {
        super(source);
    }
}

class MyDogEvent extends DogEvent {

    public MyDogEvent(Object source) {
        super(source);
    }
}